package com.fessc.develop.exception;

import com.fessc.develop.base.CCBResult;
import com.fessc.develop.base.Result;


/**
 * 业务处理异常
 *  指用户输入了非法数据等业务逻辑存在的异常
 * @Auther:
 * @Date:
 */
public class CCBBusinessException extends BaseException {
    private CCBResult result = new CCBResult();

    public CCBBusinessException(CCBResult result) {
        super(result.getStatusCode()+ ":" + result.getStatusMsg());
        this.result = result;
    }

    public CCBBusinessException(String code, String msg) {
        super(code + ":" + msg);
        this.result.setStatusCode(code);
        this.result.setStatusMsg(msg);
    }

    public CCBBusinessException(CCBResult result, Throwable cause) {
        super(result.getStatusCode() + ":" + result.getStatusMsg(), cause);
        this.result = result;
    }

    public CCBBusinessException(String code, String msg, Throwable cause) {
        super(code + ":" + msg, cause);
        this.result.setStatusCode(code);
        this.result.setStatusMsg(msg);
    }

    public CCBResult getResult() {
        return result;
    }

    public void setResult(CCBResult result) {
        this.result = result;
    }
}
